home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / pctj8504.arc / SMALL.ASM < prev    next >
Assembly Source File  |  1986-09-14  |  2KB  |  76 lines

  1. Page    60,132 
  2. Title    SMALL -- Load EGA 8x8 Font for 25 or 43 Line Screens
  3.  
  4. Subttl    Thomas V. Hoffmann, January 1985 
  5.  
  6. ;--This program selects 80x25 alpha color mode (mode 3), loads the 
  7. ;  EGA character generator with the 8x8 font, and causes BIOS to 
  8. ;  recalculate the video parameters for maximum screen dimensions.
  9. ;  With 350-line displays, this gives 43 lines per screen. 
  10. ;  With 200-line displays, this gives 25 lines per screen. 
  11.  
  12. Stack    segment    para stack 'stack' 
  13.     dw    64 dup (0) 
  14. Stack    Ends 
  15.  
  16. Bdata    segment at 40H          ;-- BIOS data segment 
  17.     org    63H 
  18. CRTC    dw    ?         ; Base I/O address of CRTC 
  19.     org    87H 
  20. info    db    ?         ; Bit 0=1 inhibits cursor emulation 
  21. Bdata    Ends 
  22.  
  23. Code    segment    para public 'code' 
  24. Small    proc    far 
  25.     Push    es         ; Push ES:0 for return to DOS 
  26.     Sub    ax,ax 
  27.      Push    ax 
  28.     Mov    ax,Bdata    ; Set DS to BIOS data segment 
  29.     Mov    ds,ax 
  30.      assume    ds:Bdata 
  31.  
  32.     Mov    ax,0003H    ; Set 80-column alpha mode 
  33.     Int    10H 
  34.  
  35.     Mov    ax,1112H    ; Load 8x8 font 
  36.     Mov    bl,0         ;   into block 0 
  37.     Int    10H         ;   and recalc screen 
  38.  
  39. ; This code sets the EGA CRTC cursor register directly, after
  40. ; inhibiting the BIOS cursor emulation function.  On 350-line
  41. ; displays, this prevents BIOS from setting the cursor to lines
  42. ; 11 and 12, which are not displayed for 8-line characters.
  43.  
  44.     Or    info,1         ; Inhibit cursor emulation 
  45.     Mov    ax,0100H    ; Set cursor 
  46.     Mov    bh,0         ;   for page 0 
  47.     Mov    cx,0600H    ;   to last two lines 
  48.      Int    10H         ;    (start on 6, off on 0) 
  49. page 
  50.  
  51. ; This code sets the underline location register in the CRTC to 
  52. ; the last line of the character box (line 7).  BIOS incorrectly
  53. ; sets it to line 8, which is not displayed. 
  54.  
  55.     Mov    dx,CRTC         ; Get CRTC base address 
  56.     Mov    al,14H         ; Select underline loc register 
  57.     Out    dx,al 
  58.     Inc    dx         ; Point DX to CRTC data register 
  59.     Mov    al,7         ; Set underline loc to line 7 
  60.     Out    dx,al 
  61.  
  62. ; This code enables the EGA BIOS print screen routine, which
  63. ; can handle non-standard display dimensions.  In this case
  64. ; it handles 43 lines of characters on 350-line displays. 
  65.  
  66.     Mov    ax,1200H    ; Select EGA screen print 
  67.     Mov    bl,20H         ;   routine 
  68.     Int    10H 
  69.  
  70.     Ret              ; Return to DOS 
  71. Small    Endp 
  72. Code    Ends 
  73.     End 
  74.